package com.youtui.manager.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/image")
public class ImageUploadController extends BaseController {

/* private @Autowired ImageUpload imageUpload;

 
    
	*//**
	 * 文件上传
	 * @param uploadfile
	 * @param fileName
	 * @return
	 * @throws Exception
	 *//*
	@RequestMapping({"/upload.do" })
	@ResponseBody
	public Msg upload(@RequestParam("file") String file,
			@RequestParam("fileName") String fileName,@RequestParam("mpackage") String mpackage) throws Exception {
		String localPath = request.getSession().getServletContext().getRealPath("/");
		if (file == null) {
			return Msg.init(Msg.STATUS_FAILED, Msg.FAILED, "文件不能为空");
		}
		String rtn=imageUpload.GenerateImage(localPath,file.split("base64,")[1], fileName,mpackage);
		return Msg.init(Msg.STATUS_SUCCESS, Msg.SUCCESS, rtn);
	}

	public String changeFileName(String fileName) {
		if (StringUtils.isBlank(fileName))
			return fileName;
		try {
			String[] part = fileName.split("\\.");
			StringBuffer newFileName = new StringBuffer();
			newFileName.append(URLEncoder.encode(part[0], SystemConst.CHARACTER_ENCODING_DEFAULT));
			newFileName.append(DateUtil.getDateStr(DateTypeEditor.DF_LONG_COMP_STR));
			newFileName.append(".");
			newFileName.append(part[1]);
			return newFileName.toString();
		} catch (Exception e) {
			return fileName;
		}
	}

	*/


}
